<!DOCTYPE html>
<html lang="en">


<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Vue基础</title>
</head>


<body>
<div id="app">
    请输入第一个加数:<input type="text" v-model="data1" name="" id=""><br>
    请输入第二个加数:<input type="text" v-model="data2" name="" id=""><br>
    <input type="button" @click="clickone" value="计算"><br>
    结果为:<input type="text" v-model="sum" name="" id="">
</div>

  <!-- 开发环境版本，包含了有帮助的命令行警告 -->
  <script src="vue.js"></script>
<script>
    var app=new Vue({
        el:"#app",
        data:{
            data1:"",
            data2:"",
            sum:"",
        },
        methods: {
            clickone(){
                this.sum=parseInt(this.data1)+parseInt(this.data2)
            }
        },
    })
</script>

</body>


</html>